package util 
{
	import flash.geom.Point;
	import flash.text.TextLineMetrics;
	import mx.controls.TextArea;
	/**
	 * ...
	 * @author Nevena
	 */
	public class TextUtil 
	{
		public static function cursorPosition(myTextArea:TextArea):Point
		{
			var textHeight:Number = myTextArea.textHeight;
			var lineHeight:Number = myTextArea.getLineMetrics( 0 ).height;
			var numLines:Number = Math.ceil( textHeight/lineHeight );
			var currentLineMet:TextLineMetrics = myTextArea.getLineMetrics( numLines-1 );
			var xPos:Number = currentLineMet.width + myTextArea.x;
			var yPos:Number = textHeight - ( lineHeight * myTextArea.verticalScrollPosition );
			return new Point(xPos, yPos);
		}
		
		
	}

}